#include "CWinTest.h"

LRESULT CWinTest::OnDestroyHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    PostQuitMessage(0);
    return TRUE;
}

LRESULT CWinTest::OnPaintHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    PAINTSTRUCT Ps = { 0 };
    PCWCH lpString = _T("HelloWOrld");
    HDC hDC = BeginPaint(&Ps);
    TextOut(hDC, 0, 0, lpString, wcslen(lpString));
    EndPaint(&Ps);
    return TRUE;
}

LRESULT CWinTest::OnCreateHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    m_hButton = CreateWindow(_T("Button"), _T("Test"), WS_VISIBLE | WS_CHILD,
        50, 30, 100, 35, m_hWnd, (HMENU)IDD_BUTTON_TEST, _AtlBaseModule.GetModuleInstance(), nullptr);
    return TRUE;
}

LRESULT CWinTest::OnCommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
    MessageBox(_T("Button"));
    return TRUE;
}